#include "loginviewmodel.h"

LoginViewModel::LoginViewModel(BaseViewModelManager *manager):BaseViewModel(manager)
{
    createView(new LoginView());
    createModel(new LoginModel());
}

void LoginViewModel::update(QSharedPointer<Data> dataPtr)
{
    setModel(dataPtr);
    QSharedPointer<LoginData> loginDataPtr = dataPtr.dynamicCast<LoginData>();
    qDebug() << loginDataPtr->getAccount()<<" "<< loginDataPtr->getPassword()<<" "<<loginDataPtr->getRole();
    notify("MainViewModel");
}

LoginViewModel::~LoginViewModel()
{

}
